<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>搜索页面</title>

		<link href="../AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />
		<link href="../AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css" />

		<link href="../basic/css/demo.css" rel="stylesheet" type="text/css" />
		
		<link href="../css/seastyle.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../js/bootstrap/css/bootstrap.css" />
		<script type="text/javascript" src="../js/vue2.5.js" ></script>
		<script type="text/javascript" src="../js/axios.min.js" ></script>
		<script type="text/javascript" src="../js/jquery-1.11.2.min.js" ></script>
		<script type="text/javascript" src="../js/global.js" ></script>
		<script type="text/javascript" src="../js/bootstrap/js/bootstrap.js" ></script>
		<script type="text/javascript" src="../js/layer/layer.js" ></script>
		<script src="../js/param.js"></script>
		<script type="text/javascript" src="../basic/js/jquery-1.7.min.js"></script>
		<script type="text/javascript" src="../js/script.js"></script>
		
	</head>

	<body>

		
			<div class="clear"></div>
			<b class="line" style="top:55px;"></b>
           <div class="search container">
			<div class="search-list">
			<div class="nav-table">
					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
							<ul>
							<li class="index"><a href="../index.html">首页</a></li>
							<li class="qc"><a href="../person/text.html">推荐</a></li>
							<li class="qc"><a href="search.html">搜索</a></li>
							<li class="qc"><a href="#">团购</a></li>
							<li class="qc last"><a href="../person/about.html">我们</a></li>
						</ul>
						</div>
			</div>
			
				
					<div class="am-g am-g-fixed">
						<div class="am-u-sm-12 am-u-md-12">
	                  	<div class="theme-popover">														
							<div class="searchAbout">
								<span class="font-pale">相关搜索：</span>
								<a title="坚果" href="#">李子</a>
								<a title="瓜子" href="#">芒果</a>
							</div>
							<ul class="select">
								<p class="title font-normal">
									<span class="fl">{{gname}}</span>
									<span class="total fl">搜索到<strong class="num">{{pager.recordCount}}</strong>件相关商品</span>
								</p>
								<div class="clear"></div>
								<li class="select-result">
									<dl>
										<dt>已选</dt>
										<dd class="select-no"></dd>
										<p class="eliminateCriteria">清除</p>
									</dl>
								</li>
								<div class="clear"></div>
								<li class="select-list">
									<dl id="select1" @click="query(1)">
										<dt class="am-badge am-round">产地</dt>	
									
										 <div class="dd-conent">										
											<dd class="select-all selected"><a href="#">全部</a></dd>
											<dd><a href="#">四川</a></dd>
											<dd><a href="#">昭化</a></dd>
											<dd><a href="#">曲回</a></dd>
											<dd><a href="#">朝阳</a></dd>
											
										 </div>
						
									</dl>
								</li>
								<li class="select-list">
									<dl id="select2" @click="query(1)">
										<dt class="am-badge am-round">价格</dt>
										<div class="dd-conent">
											<dd class="select-all selected"><a href="#">全部</a></dd>
											<dd><a href="#">&lt;5</a></dd>
											<dd><a href="#">5~15</a></dd>
											<dd><a href="#">15~20</a></dd>
											<dd><a href="#">&gt;20</a></dd>
										</div>
									</dl>
								</li>
								
					        
							</ul>
							<div class="clear"></div>
                        </div>
							<div class="search-content" style="width:1140px;">
								
								<div class="clear"></div>

								<ul class="am-avg-sm-3 am-avg-md-4 am-avg-lg-5 boxes">
									<li v-for="(goods,index) in goodsData">
										<div class="i-pic limit">
											<a :href="'introduction.jsp?gid='+goods.gid">
												<img :src="baseUrl+'/goods/getgoods?gid='+ goods.gid" />	
											</a>								
											<p class="title fl">{{goods.gname}} &nbsp; {{goods.gdesc}}</p>
											<p class="price fl">
												<b>¥</b>
												<strong>{{goods.gprice}}</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
								</ul>
							</div>
							
							<div class="clear"></div>
							<!--分页工具条-->
							<div id="row">
								<div class="col-sm-4">
									<div class="pageInfo">
										共{{pager.recordCount}}条数据{{pager.pageNum}}/{{pager.pageCount}}页
									</div>
								</div>
								<nav class="col-sm-8">
									<nav id="pageNav">
										<ul class="pagination pagination-sm pull-right">
											<li><a href="javascript:;" id="firstPage" @click="query(1)" v-show="pager.pageNum!=1">首页</a></li>
											<li><a href="javascript:;" id="prevPage" @click="query(pager.pageNum-1)" v-show="pager.pageNum!=1">上一页</a></li>
											<li :class="{active:pager.pageNum==i}" v-for="i in pageBtns"> <a href="javascript:;" @click="query(i)">{{i}}</a></li>
											<li><a href="javascript:;" id="nextPage" @click="query(pager.pageNum+1)" v-show="pager.pageNum!=pager.pageCount">下一页</a></li>
											<li><a href="javascript:;" id="lastPage" @click="query(pager.pageCount)" v-show="pager.pageNum!=pager.pageCount">末页</a></li>
										</ul>
									</nav>
								</nav>	
							</div>	

						</div>
					</div>
					<div class="footer">
						<div class="footer-hd">
							<p>
								
								<b>|</b>
								<a href="#">商城首页</a>
								<b>|</b>
								<a href="#">支付宝</a>
								<b>|</b>
								<a href="#">物流</a>
							</p>
						</div>
						<div class="footer-bd">
							<p>
								
								<a href="#">合作伙伴</a>
								<a href="#">联系我们</a>
								<a href="#">网站地图</a>
								<em>© 2015-2025 Hengwang.com 版权所有. 更多模板 <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></em>
							</p>
						</div>
					</div>
				</div>

			</div>

		<!--引导 -->
		<div class="navCir">
			<li><a href="home2.html"><i class="am-icon-home "></i>首页</a></li>
			<li><a href="sort.html"><i class="am-icon-list"></i>分类</a></li>
			<li><a href="shopcart.html"><i class="am-icon-shopping-basket"></i>购物车</a></li>	
			<li><a href="../person/index.html"><i class="am-icon-user"></i>我的</a></li>					
		</div>

	
		
		<div class="theme-popover-mask"></div>
		
		<script>
		var gname= localStorage.getItem('gname');
		
		var vue = new Vue({
			el:'.container',
			data:{
				goodsData:[],
				gname:localStorage.getItem('gname'),
				baseUrl:baseUrl,
				pager: {},
				pageBtns: []//分页按钮数组
			},methods:{
				query:function(pageNum){

					if(pageNum == this.pager.pageCount){
						layer.msg('没有更多了');
					}
					
					axios.get(baseUrl + '/goods/queryByCondition',{
						params:{
							pageNum:pageNum,
							pageSize:5,
							gname:gname,
							gplace:$('#selectA a').text(),
							gprice:$('#selectB a').text()
						}
					})
						.then(function(response) {
							
							this.goodsData = response.data.list;
							this.pager = response.data.pager;
							//生成分页页码按钮
							var start = this.pager.pageNum - 2;
							var end = this.pager.pageNum + 2;

							if (this.pager.pageNum <= 3) {
								start = 1;
								end = 5;
							}
							if (end > this.pager.pageCount)
								end = this.pager.pageCount;
							this.pageBtns = [];

							for (var i = start; i <= end; i++) {
								this.pageBtns.push(i);
							}
							
						}.bind(this))
						.catch(function(error) {
							layer.msg('请求失败');
						});
				}
				
			},mounted:function(){
				this.query(1);
			}	
		});
		
		
		</script>
		
		<script>
			window.jQuery || document.write('<script src="basic/js/jquery-1.9.min.js"><\/script>');
		</script>
		<script type="text/javascript" src="../basic/js/quick_links.js"></script>
		
		<script>
		$(function(){
			if(localStorage.getItem('LoginName')){
				$('#LoginName').text(localStorage.getItem('LoginName'));
			}
			
		});
			
		
		</script>
		
	</body>

</html>